package cn.edu.zust.se.springmvctest.model;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * 
 * @author czg
 * @since 2022/11/29 21:47
 */
@Data
public class User {
    Integer id;
    @NotNull
    String name;
//    @Pattern(regexp="w{6,20}")
    String userName;
    @NotNull
    String password;
    String email;
    String mobile;
    @Min(15)
    @Max(30)
    int age;
    @Past
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    Date birth;
}
